<!--ID:one-life-->
<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link href="../../libs/mui.min.css" rel="stylesheet"/>
    <link href="../../libs/app.css" rel="stylesheet"/>
    <link href="../../css/main.css" rel="stylesheet"/>
    <link href="../../css/assess-d.css" rel="stylesheet"/>
</head>

<body>
<div class="head">
    <img class="mui-action-back" src="../../images/all-left.png" alt="">
    <p>人寿保单贷评估</p>
</div>
<div class="content">
    <!--列表-->
    <div class="list">
        <!--类型-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <a href="#showlx">
                    <div class="lx-le">保单类型</div>
                    <div id="info-lx" class="lx-ri info-lx">选择</div>
                </a>
            </div>
        </div>
        <div id="showlx" class="showlx mui-popover mui-popover-action mui-popover-bottom">
            <ul class="mui-table-view insurance-type">
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">平安人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">中国人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">新华人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">泰康人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">太平洋人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">人保人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">生命人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">太平人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">友邦人寿</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">阳光人寿</a>
                </li>
            </ul>
            <ul class="mui-table-view ">
                <li class="mui-table-view-cell popover-bottom-remove">
                    <a href="#showlx">取消</a>
                </li>
            </ul>
        </div>
        <!--保单编号
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <div class="lx-le">保单编号</div>
                <div class="lx-ri"><input type="text" class="bd-ri number" placeholder="请输入保单编号" value="" type="number"></div>
            </div>
        </div>-->
        <!--购买保单金额-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <div class="lx-le">缴费金额</div>
                <div class="lx-ri">
                    <input class="bd-ri mr2em price" placeholder="请输入金额" value="" type="number">
                    <span class="bd-m">万元</span>
                </div>
            </div>
        </div>
        <!--保单已缴费-->
        <!--id="xl-y"-->
        <div class=" mui-table-view">
            <div class="mui-table-view-cell">
                <a href="#already-pm">
                    <div class="lx-le">投保时间</div>
                    <div id="payment-y" class="payment payment-yj lx-ri">选择</div>
                </a>
            </div>
        </div>
        <div id="already-pm" class="payment-y mui-popover mui-popover-action mui-popover-bottom">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">6个月</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">24个月</a>
                </li>
            </ul>
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom-remove">
                    <a href="#already-pm">取消</a>
                </li>
            </ul>
        </div>
        <!--保单已缴费次数-->
        <!--id="xl-c"-->
        <div class="mui-table-view">
            <div class="mui-table-view-cell">
                <a href="#numbe">
                    <div class="lx-le">缴费次数</div>
                    <div id="payment-c" class="payment payment-cs lx-ri">选择</div>
                </a>
            </div>
        </div>
        <div id="numbe" class="payment-c mui-popover mui-popover-action mui-popover-bottom">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">1次</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">3次</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">4次</a>
                </li>
            </ul>
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom-remove">
                    <a href="#numbe">取消</a>
                </li>
            </ul>
        </div>
        <!--还款期限-->
        <!--id="xl"-->
        <!--<div class="mui-table-view">
            <div class="mui-table-view-cell">
                <a href="#term">
                    <div class="lx-le">还款期限</div>
                    <div id="infoone" class="payment infoone-qx lx-ri">选择</div>
                </a>
            </div>
        </div>
        <div id="term" class="bg infoone mui-popover mui-popover-action mui-popover-bottom">
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">12期</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">24期</a>
                </li>
                <li class="mui-table-view-cell popover-bottom">
                    <a href="#">36期</a>
                </li>
            </ul>
            <ul class="mui-table-view">
                <li class="mui-table-view-cell popover-bottom-remove">
                    <a href="#term">取消</a>
                </li>
            </ul>
        </div>-->
    </div>
    <!--按钮-->
    <div class="buttons">
        <div class="add add-button">继续添加</div>
        <div class="add add-submit" id="evaluate">提交</div>
    </div>

</div>

<script src="../../libs/mui.min.js"></script>
<script src="../../js/jquery-3.1.1.min.js"></script>
<script src="../../js/url.js"></script>
<script src="../../js/assess-public.js"></script>
<script>
    $(function () {
//        var hold = plus.webview.currentWebview().hold;
        var cw = JSON.parse(localStorage.getItem('evaluate-oneLife'));
        var hold = cw.hold;
//        hold && $.closePages([hold]);// 保留当前
        if (hold) {
            // 返回是跳转到首页
            $('.head img').removeAttr('class');
            $('.head img').on('tap', function () {
                window.location.href = '../head-foot-demo.html'
            });
        }
        localStorage.removeItem('evaluate-oneLife');
    });

    // 提交
    var params = new ToArr();
    $('#evaluate').on('tap', function () {
        //各参数数组
        var type = params.getType('.info-lx')
//				var numbers = params.getStr('.number');
        var price = params.rechange('.price');
//				var stage = params.rechange('.infoone-qx', "期");
        var month = params.rechange('.payment-yj', "个月");
        var sub = params.rechange('.payment-cs', "次");

        //将各参数数组转换成符合格式的请求参数
        var arrObj = {type: type, month: month, price: price, sub: sub};// stage: stage,
        var resParam = params.getParams(arrObj); // return ObjArr

        var yuan = /^[0-9]+(.[0-9]{1,4})?$/;
        for (var i = 0; i < resParam.length; i++) {
            /*if(numbers[i] == '') {
             mui.toast('请检查您的保单编号...');
             return false;
             } else */
            if ((!yuan.test(price[i])) || price[i] == '') {
                mui.toast('请检查您购买保单金额...');
                return false;
            } else if (type[i] == undefined || month[i] == undefined || sub[i] == undefined) {//|| stage[i] == undefined
                mui.toast('请把信息填充完整...');
                return false;
            } else {
                if (i === resParam.length - 1) {
                    params.getAjax("rsbd", resParam)
                }
            }
        }
    });
    //判断是否从申请页过来
    localStorage.isAssess === 'rsbd' ? mui.toast('请您先进行该项评估！') : '';
    localStorage.removeItem('isAssess');
    //添加
    var addI = 1;

    var addList = '<div class="list">' +
        '<!--类型--><div class="mui-table-view">' +
        '<div class="mui-table-view-cell"><a href="#showlx-' + addI + '"><div class="lx-le">保单类型</div><div id="info-lx" class="lx-ri info-lx">选择</div></a></div></div><div id="showlx-' + addI + '" class="showlx mui-popover mui-popover-action mui-popover-bottom"><ul class="mui-table-view insurance-type"><li class="mui-table-view-cell popover-bottom"><a href="#">平安人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">中国人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">新华人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">泰康人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">太平洋人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">人保人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">生命人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">太平人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">友邦人寿</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">阳光人寿</a></li></ul><ul class="mui-table-view"><li class="mui-table-view-cell popover-bottom-remove"><a href="#showlx-' + addI + '">取消</a></li></ul></div>' +
        '<!--缴费金额--><div class="mui-table-view"><div class="mui-table-view-cell"><div class="lx-le">缴费金额</div><div class="lx-ri"><input type="text" class="bd-ri price" placeholder="请输入金额" value="" type="number" /><span class="bd-m">万元</span></div></div></div>' +
        '<!--投保时间--><div  class=" mui-table-view"><div class="mui-table-view-cell"><a href="#already-pm-' + addI + '"><div class="lx-le">投保时间</div><div id="payment-y" class="payment payment-yj lx-ri">选择</div></a></div></div><div id="already-pm-' + addI + '" class="payment-y mui-popover mui-popover-action mui-popover-bottom"><ul class="mui-table-view"><li class="mui-table-view-cell popover-bottom"><a href="#">6个月</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">24个月</a></li></ul><ul class="mui-table-view"><li class="mui-table-view-cell popover-bottom-remove"><a href="#already-pm-' + addI + '">取消</a></li></ul></div>' +
        '<!--缴费次数--><div  class="mui-table-view"><div class="mui-table-view-cell"><a href="#numbe-' + addI + '"><div class="lx-le">缴费次数</div><div id="payment-c-' + addI + '" class="payment payment-cs lx-ri">选择</div></a></div></div><div id="numbe-' + addI + '" class="payment-c mui-popover mui-popover-action mui-popover-bottom"><ul class="mui-table-view"><li class="mui-table-view-cell popover-bottom"><a href="#">1次</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">3次</a></li><li class="mui-table-view-cell popover-bottom"><a href="#">4次</a></li></ul><ul class="mui-table-view"><li class="mui-table-view-cell popover-bottom-remove"><a href="#numbe">取消</a></li></ul></div>' +
        '</div>';
    params.append(addList);
</script>
</body>

</html>